package com.ruoyi.project.lely.bean.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;

/**
 * 订单商品
 *
 * @author luoyong
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "`ly_order_goods`", autoResultMap = true)
public class LyOrderGoods {


    @ApiModelProperty("ID")
    @TableId("id")
    private Long id;


    @NotNull
    @ApiModelProperty("订单表的订单ID")
    @TableField(value = "`order_id`")
    private Integer orderId;


    @ApiModelProperty("入驻品牌店铺编码")
    @TableField(value = "`brand_id`")
    private Integer brandId;


    @NotNull
    @ApiModelProperty("商品表的商品ID")
    @TableField(value = "`goods_id`")
    private Integer goodsId;


    @Length(max = 127, message = "商品名称长度不能超过127位")
    @NotEmpty
    @ApiModelProperty("商品名称")
    @TableField(value = "`goods_name`")
    private String goodsName;


    @Length(max = 63, message = "商品编号长度不能超过63位")
    @NotEmpty
    @ApiModelProperty("商品编号")
    @TableField(value = "`goods_sn`")
    private String goodsSn;


    @NotNull
    @ApiModelProperty("商品货品表的货品ID")
    @TableField(value = "`product_id`")
    private Integer productId;


    @NotNull
    @ApiModelProperty("商品货品的购买数量")
    @TableField(value = "`number`")
    private Integer number;


    @Digits(integer = 10 - 2, fraction = 2)
    @NotNull
    @ApiModelProperty("商品货品的售价")
    @TableField(value = "`price`")
    private BigDecimal price;


    @Length(max = 1023, message = "商品货品的规格列表长度不能超过1023位")
    @NotEmpty
    @ApiModelProperty("商品货品的规格列表")
    @TableField(value = "`specifications`")
    private String specifications;


    @Length(max = 255, message = "商品货品图片或者商品图片长度不能超过255位")
    @NotEmpty
    @ApiModelProperty("商品货品图片或者商品图片")
    @TableField(value = "`pic_url`")
    private String picUrl;


    @ApiModelProperty("订单商品评论，如果是-1，则超期不能评价；如果是0，则可以评价；如果其他值，则是comment表里面的评论ID。")
    @TableField(value = "`comment`")
    private Integer comment;


    @ApiModelProperty("创建时间")
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @ApiModelProperty("更新时间")
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @ApiModelProperty("逻辑删除")
    @TableField(value = "`deleted`", fill = FieldFill.INSERT)
    private Integer deleted;


    @ApiModelProperty("退款跟踪ID")
    @TableField(value = "`refund_id`")
    private Integer refundId;


    @Digits(integer = 10 - 2, fraction = 2)
    @ApiModelProperty("代理结算佣金")
    @TableField(value = "`settlement_money`")
    private BigDecimal settlementMoney;

}
